﻿using hconnect;
using System.Runtime.CompilerServices;

namespace Controller
{
    /// <summary>
    /// 传输线信号状态
    /// </summary>
    public class CarrierSignalStatus : Signal
    {
        public int inHeightStatus = 0;//高度状态
        public float inWeightValue = 0;//重量

        public int inScanArrive = 0;//入到位
        public int materialIsExist = 0;//物料有无
        public int inMaterialArrive = 0;//物料到位
        public int isRun = 0;//是否运行


        public CarrierSignalStatus(int id, int height, float weight, int scanA, int arrive,int huiArrive, int run)
        {
            p = id;
            inHeightStatus = height;
            inWeightValue = weight;
            inScanArrive = scanA;
            inMaterialArrive = arrive;
            materialIsExist = huiArrive;
            isRun = run;
        }
        public CarrierSignalStatus(int id,  int isExistMaterial, int run,int huiArrive)
        {
            p = id;
            materialIsExist = isExistMaterial;
            isRun = run;
            inMaterialArrive = huiArrive;
        }
        public bool IsScanArrive()
        {
            return inScanArrive == 1;
        }

        public override bool isArrived()
        {
            return inMaterialArrive == 1;
        }
        public override bool isFree()
        {
            return materialIsExist == 2 ;
        }
        public bool NoFree()
        {
            return materialIsExist == 1;
        }

    }
}
